﻿using System;
using System.Configuration;
using System.Net.Http;

namespace Microsoft.Cloud.API.AzurePack.Services
{
    public class WAPTenantService : WAPBaseService
    {
        private string token = null;
        private string tenantUserName = null;

        public WAPTenantService(string tenantUserName, string token)
        {
            this.tenantUserName = tenantUserName;
            this.token = token;

            TheHttpClient = new HttpClient();
            TheHttpClient.BaseAddress = new Uri(ConfigurationManager.AppSettings["tenantAPIBaseAddress"]);
            //TheHttpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
            TheHttpClient.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", this.token);
            TheHttpClient.DefaultRequestHeaders.Add("x-ms-principal-id", tenantUserName);
        }
    }
}